<!DOCTYPE html>
<html>
<head>
    <title>{if $title}{$title}{else}{if !empty($_W['account']['name'])}{$_W['account']['name']}{/if}{/if}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <!-- Mobile Devices Support @begin -->
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="apple-mobile-web-app-capable" content="yes" /> <!-- apple devices fullscreen -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <!-- Mobile Devices Support @end -->
    <meta name="keywords" content="易志科技,微信,微信公众平台" />
    <meta name="description" content="微信公众平台自助引擎" />


    <link rel="stylesheet" href="{$_W['siteroot']}/themes/mobile/style44/style/reset.css" />
    <link rel="stylesheet" href="{$_W['siteroot']}/themes/mobile/style44/style/mainCssRed.css" />

    <script type="text/javascript" src="{$_W['siteroot']}/themes/mobile/style44/script/jquery.min.js"></script>
    <script type="text/javascript" src="{$_W['siteroot']}/themes/mobile/style44/script/flexslider.js"></script>
    <script type="text/javascript" src="{$_W['siteroot']}/themes/mobile/style44/script/MainJS.js"></script>

    <!--[if IE 7]>
    <link rel="stylesheet" href="./resource/style/font-awesome-ie7.min.css">
    <![endif]-->

    <!--        Hides URL bar on iPhone-->
    <script type="application/x-javascript">
        if (navigator.userAgent.indexOf('iPhone') != -1) {
            addEventListener("load", function() {
                setTimeout(hideURLbar, 0);
            }, false);
        }

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
</head>


{php include_once IA_ROOT . '/source/modules/site/model.php'}
{php $slide = site_article_search('', 'f');}
<body>
<div id="indexWrapper">
    <!--            Index BG SLider, Put here your images-->
    <div id="IndexBGSlider" class="flexslider-bgslider">
        <ul class="slides">

            {loop $slide['list'] $v}
            <li>
                <a href="#}">
                    <img src="{$_W['attachurl']}{$v['thumb']}" alt="{$v['title']}" border="0" />
                </a>
            </li>
            {/loop}

        </ul>
    </div>
    <!--            headlineSection-->
    <div id="BigHeadline">
        <h1>{$_W['account']['name']}</h1>
    </div>
    <!--            Main Nav Section-->
    <div id="MainNavHome">
        <div class="flexslider-nav">
            <ul class="slides">
                <li>
                    {php $html="";}
                    {loop $navs $nav}
                        <?php
                            $index = strpos($nav["name"],"|");
                            if($index>0){
                                $arr = explode("|",$nav["name"]);
                                $html.= '<a href="'.$nav["url"].'"> <p>'.$arr[0].'</p><p class="NavItemInfo">'.$arr[1].'</p></a>';

                            }else{
                                $html.= '<a href="'.$nav["url"].'"> <p>'.$nav["name"].'</p></a>';
                            }
                        ?>

                    {/loop}

                    {php echo $html;}
                </li>
            </ul>
        </div>
    </div>
</div>
{if empty($footer_off)}<div id="footer" class="IndexFooter">&copy;{if empty($_W['account']['name'])}易志科技{else}{$_W['account']['name']}{/if}</div>{/if}
</div>
{if !empty($quick)}
<div class="footer-menu">
    <div class="menu-main img-rounded">
        <ul class="unstyled img-rounded">
            {loop $quick $nav}
            <li>
                <a href="{$nav['url']}" class="box-item">
                    <i class="{$nav['css']['icon']['icon']}" style="{$nav['css']['icon']['style']}"></i>
                    <span style="{$nav['css']['name']}">{$nav['name']}</span>
                </a>
            </li>
            {/loop}
        </ul>
    </div>
    <div class="menu-button img-circle"><i class="icon-plus-sign"></i></div>
</div>
{/if}
<script type="text/javascript">
    $(function() {
        $(".user-box .box-item").each(function(i) {
            i = i +1;
            if(i%3 == 0) $(this).css("border-right", "0");
        });
        $(".menu-button").click(function() {
            var a = $(this).find("i");
            if(a.hasClass("icon-plus-sign")) {
                a.removeClass("icon-plus-sign").addClass("icon-minus-sign");
                $(".menu-main").show();
            } else {
                a.removeClass("icon-minus-sign").addClass("icon-plus-sign");
                $(".menu-main").hide();
            }
        });
        $(window).scroll(function(){
            $(".menu-button").find("i").removeClass("icon-minus-sign").addClass("icon-plus-sign");
            $(".menu-main").hide();
        });
        $(".menu-main a").click(function(){ $(".menu-main").hide(); });

        //控制tab宽度
        var profile_tab = $(".nav-tabs li");
        profile_tab.css({"width": 100/profile_tab.length+"%", "text-align": "center"});

        //手机表单处理
        $(".form-table").delegate(".checkbox input[type='checkbox']", "click", function(){
            $(this).parent().toggleClass("btn-inverse");
        });
        $(".form-table").delegate(".file input[type='file']", "change", function(){
            var a = $(this).next("button");
            a.html(a.html() +' '+  $(this).val());
        });

        //处理固定横向导航条
        var navbarFixedTop = false, navbarFixedBottom = false;
        navbarFixedTop = $(".navbar").hasClass("navbar-fixed-top");
        navbarFixedBottom = $(".navbar").hasClass("navbar-fixed-bottom");
        if(navbarFixedTop) $("body").css("padding-top", "35px");
        if(navbarFixedBottom) $("body").css("padding-bottom", "35px");
    });

    //对分享时的数据处理
    function _removeHTMLTag(str) {
        str = str.replace(/<script[^>]*?>[\s\S]*?<\/script>/g,'');
        str = str.replace(/<style[^>]*?>[\s\S]*?<\/style>/g,'');
        str = str.replace(/<\/?[^>]*>/g,'');
        str = str.replace(/\s+/g,'');
        str = str.replace(/&nbsp;/ig,'');
        return str;
    }
    document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
        <?php
                $_share = array();
        $_share['title'] = (empty($title)) ? $_W['account']['name'] : $title;
        $_share['link'] = $_W['siteroot'] . str_replace('/wx/', '', $_SERVER['REQUEST_URI']) . '&wxref=mp.weixin.qq.com';
        $_share['img'] = $_W['siteroot'] . 'source/modules/' . $_GPC['name'] . '/icon.jpg';
        ?>
        var _share_img = $('body img:eq(0)').attr("src");
        if(typeof(_share_img) == "undefined") _share_img = "{$_share['img']}";
        var _share_content = _removeHTMLTag($('body').html()).replace("{$_share['title']}",'');

        window.shareData = {
            "imgUrl": _share_img,
            "timeLineLink": "{$_share['link']}",
            "sendFriendLink": "{$_share['link']}",
            "weiboLink": "{$_share['link']}",
            "tTitle": "{$_share['title']}",
            "tContent":  _share_content,
            "fTitle": "{$_share['title']}",
            "fContent":  _share_content,
            "wContent":  _share_content
        };

        // 发送给好友
        WeixinJSBridge.on('menu:share:appmessage', function (argv) {
            WeixinJSBridge.invoke('sendAppMessage', {
                "img_url": window.shareData.imgUrl,
                "img_width": "640",
                "img_height": "640",
                "link": window.shareData.sendFriendLink,
                "desc": window.shareData.fContent,
                "title": window.shareData.fTitle
            }, function (res) {
                _report('send_msg', res.err_msg);
            })
        });

        // 分享到朋友圈
        WeixinJSBridge.on('menu:share:timeline', function (argv) {
            WeixinJSBridge.invoke('shareTimeline', {
                "img_url": window.shareData.imgUrl,
                "img_width": "640",
                "img_height": "640",
                "link": window.shareData.timeLineLink,
                "desc": window.shareData.tContent,
                "title": window.shareData.tTitle
            }, function (res) {
                _report('timeline', res.err_msg);
            });
        });

        // 分享到微博
        WeixinJSBridge.on('menu:share:weibo', function (argv) {
            WeixinJSBridge.invoke('shareWeibo', {
                "content": window.shareData.wContent,
                "url": window.shareData.weiboLink
            }, function (res) {
                _report('weibo', res.err_msg);
            });
        });
    }, false);
</script>
</body>
</html>